package com.example.lib_base.app

import android.app.Application
import android.content.Context
import com.alibaba.android.arouter.launcher.ARouter
import com.bw.base.BuildConfig
import com.tencent.mmkv.MMKV
import com.umeng.commonsdk.UMConfigure
import com.umeng.socialize.PlatformConfig


open class BaseApp :Application(){

    //val Context.dataStore:DataStore
    companion object{
        lateinit var appContext: BaseApp
    }

    override fun onCreate() {
        super.onCreate()

        appContext=this


        //初始化SDK

        if (BuildConfig.DEBUG){
            ARouter.openLog()
            ARouter.openDebug()
        }
        ARouter.init(this)

        //MMKV初始化
        MMKV.initialize(this)
        UMConfigure.init(this, "5a12384aa40fa3551f0001d1", "umeng", UMConfigure.DEVICE_TYPE_PHONE, "");
        PlatformConfig.setQQZone("101830139","5d63ae8858f1caab67715ccd6c18d7a5");
        //初始化数据库
        //RoomDBUtils.initRoom(this)

    }
}